package com.spzx.channel.controller;

import com.spzx.channel.service.CategoryService;
import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.product.api.domain.vo.CategoryVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name ="H5前端分页信息")
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @Operation(summary = "获取分类树")
    @GetMapping("tree")
    public AjaxResult getCategoryTree(){
        List<CategoryVo> categoryVoList= categoryService.getCategoryTree();
        return AjaxResult.success(categoryVoList);
    }

 }
